package com.linghang.wusthelpercompetition.utils;


import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequestWrapper;

public class WordFilteredRequest extends HttpServletRequestWrapper {

    private final String filteredContent;

    public WordFilteredRequest(HttpServletRequest request, String filteredContent) {
        super(request);
        this.filteredContent = filteredContent;
    }

    @Override
    public String getParameter(String name) {
        // 返回过滤后的文本
        return "content".equals(name) ? filteredContent : super.getParameter(name);
    }
}
